<template>
  <div class="content-wrap">
    <el-descriptions title="基本资料" :column="3">
      <el-descriptions-item label="订单时间">{{info1.createTime}}</el-descriptions-item>
      <el-descriptions-item label="患者姓名">{{info1.patientName}}</el-descriptions-item>
      <el-descriptions-item label="处方号">{{info1.takeMedicineIdentityValue}}</el-descriptions-item>
      <el-descriptions-item label="患者身份证号">{{info1.patientIdentityCardNo}}</el-descriptions-item>
      <el-descriptions-item label="患者联系方式">{{info1.patientPhone}}</el-descriptions-item>
      <el-descriptions-item label="客户处方单号">{{info1.prescriptionNos}}</el-descriptions-item>
      <el-descriptions-item label="凭证图片">{{info1.proofImages}}</el-descriptions-item>
    </el-descriptions>
    <el-descriptions title="收寄信息" :column="3">
      <el-descriptions-item label="医疗机构"></el-descriptions-item>
    </el-descriptions>
    <el-table
      :data="medicalRecordDiagnosisList"
      border
      style="width: 100%; margin-top: 30px"
    >
      <el-table-column label="订单号" align="center" prop="orderid" />
      <el-table-column label="医院的商品编码" align="center" prop="skuid" />
      <el-table-column label="erp的商品编码" align="center" prop="goodsid" />
      <el-table-column label="erp的商品名称" align="center" prop="goodsname" />
      <el-table-column label="单价" align="center" prop="price" />
      <el-table-column label="数量" align="center" prop="goodsqty" />
      <el-table-column label="金额" align="center" prop="money" />
    </el-table>
  </div>
</template>

<script>
import {
  getCreatePatientInfo,
  getCreateCargoDetail,
  getCreateContactInfo,
  getCreateService,
  getCreateWeiPaiParams,
} from "@/api/sf/createOrder";
export default {
  props: ["id"],
  data() {
    return {
      // 假设有初始数据
      medicalRecordDiagnosisList: [],
      info1: null, //患者信息
      info2: null, //物品信息
      info3: null, //寄件信息
      info4: null, //其他服务
      info5: null, //微派信息
      PAY_TYPE: {
        1: "货到付款",
        4: "在线支付",
        6: "到店支付",
        "": "无",
      },
      gend: { 0: "未知", 1: "男", 2: "女", 9: "未说明" },
    };
  },
  created() {
    this.getDetail1(); // 患者信息
    this.getDetail2(); // 物品信息
    this.getDetail3(); // 收寄件信息
    this.getDetail4(); // 其他服务
    this.getDetail5(); // 微派信息
  },
  methods: {
    // 患者信息
    getDetail1() {
      getCreatePatientInfo(this.id).then((response) => {
        this.info1 = response.data;
      });
    },
    // 物品信息
    getDetail2() {
      getCreateCargoDetail(this.id).then((response) => {
        this.info2 = response.data;
      });
    },
    // 收寄件信息
    getDetail3() {
      getCreateContactInfo(this.id).then((response) => {
        this.info3 = response.data;
      });
    },
    // 其他服务
    getDetail4() {
      getCreateService(this.id).then((response) => {
        this.info4 = response.data;
      });
    },
    // 微派信息
    getDetail5() {
      getCreateWeiPaiParams(this.id).then((response) => {
        this.info5 = response.data;
      });
    },
  },
};
</script>
<style scoped lang="scss">
.content-wrap {
  padding: 32px 0 32px 0;
}
</style>
